<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<script type="text/javascript" src="../js/jquery-1.12.4.js"></script>
<script type="text/javascript">
    function GetRequest() {
        var url = location.search; //获取url中"?"符后的字串
        var theRequest = new Object();
        if (url.indexOf("?") != -1) {
            var str = url.substr(1);
            strs = str.split("&");
            for ( var i = 0; i < strs.length; i++) {
                theRequest[strs[i].split("=")[0]] = unescape(strs[i].split("=")[1]);
            }
        }
        return theRequest;
    }
    var Request=undefined;
    Request=GetRequest();
    var id=Request["id"];
    
    $(function () {
        $.post("../faqs/getById",{id:id},function (data) {
            $("#classes").text(data.classes.cname);
            $("#createDate").text(data.createDate);
            $("#title").text(data.title);
            $("#content").val(data.content);
        },"json")
        $("#back").click(function () {
            window.location = "index.html";
        })
    })
</script>

<body>
  <h2 style="text-align: center">常见问题检索</h2>
  <center>
      <table>
          <tbody>
            <tr>
                <td>分类：</td>
                <td id="classes"></td>
            </tr>
            <tr>
                <td>添加时间：</td>
                <td id="createDate"></td>
            </tr>
            <tr>
                <td>标题：</td>
                <td id="title"></td>
            </tr>
            <tr>
                <td>内容：</td>
                <td>
                    <textarea disabled="disabled" id="content"></textarea>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <button id="back">返回</button>
                </td>
            </tr>
          </tbody>
      </table>
  </center>
</body>
</html>